<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-jmeterAlertConfig-edit" th:object="${jmeterAlertConfig}">
		<input id="id" name="id" th:field="*{id}"  type="hidden">

		<label class="col-sm-3 control-label">启用 禁用：</label>
		<div class="radio-box">
			<input type="radio"  name="status" value="1"  th:checked="${jmeterAlertConfig.status == 1 ? true : false}"   >
			<label style="color:#2b31dc" th:text="启用" ></label>
		</div>
		<div class="radio-box">
			<input type="radio" name="status" value="0" th:checked="${jmeterAlertConfig.status == 0 ? true : false}">
			<label style="color:#2b31dc" th:text="禁用"></label>
		</div>

		<div class="form-group">
			<label class="col-sm-3 control-label">选择测试用例：</label>
			<div class="col-sm-8">
				<select id="caseId" name="caseId" class="form-control m-b" >
					<option value="" >请选择</option>
					<option th:each="item:${cases}" th:text="${item.caseName}" th:value="${item.id}" ></option>
				</select>
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-3 control-label">并发数阈值：</label>
			<div class="col-sm-8">
				<input id="threadThreshold" name="threadThreshold" th:field="*{threadThreshold}" class="form-control" type="text">
			</div>
		</div>


		<div class="form-group">
			<label class="col-sm-3 control-label">TPS阈值小于：</label>
			<div class="col-sm-8">
				<input id="tps" name="tps" th:field="*{tps}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">事务成功率小于：</label>
			<div class="col-sm-8">
				<input id="successRatio" name="successRatio" th:field="*{successRatio}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">平均响应时间大于：</label>
			<div class="col-sm-8">
				<input id="avgRespTime" name="avgRespTime" th:field="*{avgRespTime}" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">95line时间大于：</label>
			<div class="col-sm-8">
				<input id="line95" name="line95" th:field="*{line95}" class="form-control" type="text">
			</div>
		</div>
	</form>
</div>
<div th:include="include::footer"></div>
<script th:src="@{/ajax/libs/select/select2.js}"></script>
<script type="text/javascript">
	var prefix = ctx + "jmeter/jmeterAlertConfig";
	$("#form-jmeterAlertConfig-edit").validate({
		rules:{
			xxxx:{
				required:true,
			},
		}
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/edit", $('#form-jmeterAlertConfig-edit').serialize());
		}
	}


	$(function () {

		$("#caseId").select2();
		var relCaseIdList = [[${jmeterAlertConfig.caseId}]];
		$("#caseId").val(relCaseIdList).change();


	});




</script>
</body>
</html>
